/**
 * 存储模块的类型定义
 */

// 应用设置类型定义
export interface SettingsSchema {
  theme: 'light' | 'dark' | 'system';
  language: string;
  startPage: string;
  searchEngine: string;
  downloadPath: string;
  // 启动选项
  startOptions: {
    restoreTabs: boolean;
    startMinimized: boolean;
  };
  // 隐私选项
  privacy: {
    clearDataOnExit: boolean;
    doNotTrack: boolean;
    blockThirdPartyCookies: boolean;
  };
}

// 会话数据类型定义
export interface SessionSchema {
  lastClosedTabs: Array<{
    id: string;
    url: string;
    title: string;
    favicon: string;
    createdAt: number;
  }>;
  currentTabs: Array<{
    id: string;
    url: string;
    title: string;
    active: boolean;
    windowId: number;
  }>;
}

// 书签数据类型定义
export interface BookmarksSchema {
  bookmarks: Array<{
    id: string;
    title: string;
    url: string;
    parentId?: string;
    type: 'bookmark' | 'folder';
    children?: string[]; // 用于文件夹类型，保存子项的ID
    createdAt: number;
  }>;
}

// 历史记录类型定义
export interface HistorySchema {
  history: Array<{
    id: string;
    url: string;
    title: string;
    visitCount: number;
    lastVisitTime: number;
  }>;
}

// 所有Schema类型的合并
export interface StoreSchema extends SettingsSchema, SessionSchema, BookmarksSchema, HistorySchema {
}
